// 1.alloc

let buffer = Buffer.alloc(10)
console.log(buffer);

// 2.allocUnsafe

let buffer_2 = Buffer.allocUnsafe(10)
console.log(buffer_2)

// 3.from

let buffer_3 = Buffer.from('hello')
console.log(buffer_3);

let buffer_4 = Buffer.from([105, 108, 111, 118, 101, 121, 111, 117])
console.log(buffer_4.toString());


//操作
buffer[0] = 95

//溢出
buffer[0] = 356

